package com.codelab.statemachine.config;

import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.action.Action;

public class ComplexFormChoiceAction implements Action<ComplexFormStates, ComplexFormEvents> {
    @Override
    public void execute(StateContext<ComplexFormStates, ComplexFormEvents> stateContext) {
        System.out.println("into ComplexFormChoiceAction");
        Form form = stateContext.getMessage().getHeaders().get("form", Form.class);
        System.out.println(form);
        System.out.println(stateContext.getStateMachine().getState());
    }
}
